package com.strategy.demo.Service.impl;

import com.strategy.demo.Service.PaymentService;
import com.strategy.demo.model.Order;
import com.strategy.demo.model.PayResult;
import org.springframework.stereotype.Service;

/**
 * @Author Chill_Lyn
 * @Date 2021/4/30 11:21
 */
@Service("AliPay")
public class AliPayService implements PaymentService {
    /**
     * 提前校验是否支持支付
     *
     * @param order
     * @return
     */
    @Override
    public boolean isSupport(Order order) {
        return "AliPay".equals(order.getPaymentMethod());
    }

    /**
     * 支付
     *
     * @param order
     */
    @Override
    public PayResult pay(Order order) {
        System.out.println("AliPay");
        return null;
    }
}
